package br.edu.fanor.esfinge.dao.impl;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import br.edu.fanor.esfinge.dao.AreaAcademicaDAO;
import br.edu.fanor.esfinge.entity.AreaAcademica;

@Stateless(mappedName="ejb/AreaAcademicaDAO")
public class AreaAcademicaDAOImpl implements AreaAcademicaDAO{
	
	@PersistenceContext
	private EntityManager emr;

	@Override
	public AreaAcademica inserir(AreaAcademica areaacademica) {
		emr.persist(areaacademica);
		return areaacademica;
	}

	@Override
	public AreaAcademica buscarId(long id) {
		return emr.find(AreaAcademica.class, id);

	}

	@Override
	public void remover(AreaAcademica areaacademica) {
		emr.remove(areaacademica);
		
	}

}
